
/**
 * This class will holds names in array and print it using for each loop
 * 
 * @author Shawn Rajput
 *
 */
public class ArrayStudentsNameDemo {

	public static void main(String[] args) {
		
		// Created an array of size 4
		Student[] students = new Student[4];
		
		// Created objects and added values
		Student students1 = new Student();
		students1.name = "Almas Ain";

		Student students2 = new Student();
		students2.name = "Anuradha Anuradha";

		Student students3 = new Student();
		students3.name = "Arman. M Khan";

		Student students4 = new Student();
		students4.name = "Cheryl Dixon";

		// putting students into array
		students[0] = students1;
		students[1] = students2;
		students[2] = students3;
		students[3] = students4;

		// looping through array students and put them in variable s
		for(Student s : students)
		{
			System.out.println("Student's name = " + s.name);
		}
	}
}
